package com.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.entity.Carpool;
import com.mapper.CarpoolMapper;

@Service
public class CarpoolService {
	@Autowired
	CarpoolMapper carpoolMapper;
	
	/**插入拼车*/
    public Integer insertCarpool(Carpool carpool) {
    	return carpoolMapper.insertCarpool(carpool);
    }
    /**查询拼车记录 */
   	public List<Carpool> lookCarpool(Carpool carpool){
   		return carpoolMapper.lookCarpool(carpool);
   	}
   	/**查询一条拼车记录 */
	public Carpool lookIdCarpool(Integer carpool_id) {
		return carpoolMapper.lookIdCarpool(carpool_id);
	}
	/**修改一条具体的拼车记录*/
	public Integer updateCarpool(Carpool carpool) {
		return carpoolMapper.updateCarpool(carpool);
	}
	/**修改一条具体的拼车状态*/
	public Integer updateFlagCarpool(Carpool carpool) {
		return carpoolMapper.updateFlagCarpool(carpool);
	}
	/**删除一条具体的拼车记录*/
	public Integer deleteCarpool(Integer carpool_id) {
		return carpoolMapper.deleteCarpool(carpool_id);
	}
	/**查询以过拼车*/
    public Integer LookCarpoolCount() {
    	return carpoolMapper.LookCarpoolCount();
    }
    /**查询以过拼车总数 */
   	public List<Carpool> queryAllCarpools(int limit, int page){
   		return carpoolMapper.queryAllCarpools(limit, page);
   	}
   	/**查询未过拼车*/
    public Integer LookUnCarpoolCount() {
    	return carpoolMapper.LookUnCarpoolCount();
    }
    /**查询未过拼车总数 */
   	public List<Carpool> queryAllUnCarpools(int limit, int page){
   		return carpoolMapper.queryAllUnCarpools(limit, page);
   	}
}
